import re


def validate_email(email: str) -> bool:
    """验证邮箱格式"""
    if email is None:
        return True  # 允许email为None
    email_regex = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
    return re.match(email_regex, email) is not None


# def validate_password(password: str) -> bool:
#     """验证密码强度"""
#     # 密码至少8个字符，包含大小写字母、数字和特殊字符
#     password_regex = r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$'
#     return re.match(password_regex, password) is not None


def validate_mobile(mobile: str) -> bool:
    """验证电话号码格式"""
    if mobile is None:
        return True  # 允许mobile为None
    mobile_regex = r'^\d{11}$'  # 假设电话号码为11位数字
    return re.match(mobile_regex, mobile) is not None
